package com.nxn.core.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nxn.core.dao.EntityDao;
import com.nxn.core.dao.PermissionDao;
import com.nxn.core.model.Permission;
import com.nxn.core.service.PermissionService;

/**
 * Implement Services needed to edit and save
 * a permission object's state.
 * @author Michael
 *
 */

@Service
public class PermissionServiceImpl extends EntityManagerImpl<Permission, Long> implements PermissionService {
	
    @Autowired
	private PermissionDao permissionDao;
	
	@Override
	public EntityDao<Permission, Long> getSearchImpl() {
		return permissionDao;
	}

	@Override
	public Permission findByName(String value) {
		return getSearchImpl().findByProperty("name", value).get(0);
	}
	
}
